package com.es.v10;

import framework.ElasticSearchOpTemplate;
import framework.ElasticSearchTemplate;
import framework.EsWrapperSearchResponse;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/3/28.
 *  从5.0 调用 server1.7的服务器
 */
public class TestEsServer2 {
    public static void main(String[] args)throws  Exception{
        searchProperty();
    }

    public static void searchProperty(){
        ElasticSearchTemplate elasticSearchTemplate = new ElasticSearchOpTemplate();
        QueryBuilder m1 = QueryBuilders.termQuery("propertyId", "1");
        EsWrapperSearchResponse esWrapperSearchResponse =  elasticSearchTemplate.searchRecordList(m1, "fxtweb_fxt_dev", "property", 0, 1, null);
        List<Map<String, Object>> list = esWrapperSearchResponse.getList();
        System.out.print("size:"+list.size());

    }

}
